<template>
    <div class="header">
      <div class="currentdate">
        <span style="color:#4D4D4D;font-size: 14px;font-family: Microsoft YaHei;font-weight: 400;">{{currentDate}}</span>
        <span style="margin-left:5px;margin-right:5px;"> | </span>
        <!-- <router-link to="/backstage/index" target="_blank"><span class="header-back" >水务建设质量信息管理</span></router-link> -->
        <span class="header-back"  @click="onBanner()" >水务建设质量信息管理</span>
      </div>
      <div class="logo-div">
        <!-- /cms/welcome -->
        <!-- <router-link to="/backstage/index" target="_blank"> -->
        <img class="logo" src="@/assets/logo.png" alt=""/>
        <!-- </router-link> -->
      </div>
      <div class="search">
         <!-- <a-input
             style="width:110px;height:20px;float: left;"
             v-model="search"
             />
         <a href="" class="searcchBtn">
           <img src="@/assets/search.png"/>
         </a>   -->
         <a-input-group compact>
             <a-select  default-value="请选择" size="large" style="width:120px;" v-model="pageFilter.classification">
              <template v-for="item in classification"  >
                <a-select-option :key="item.value" :value="item.value">{{item.name}}</a-select-option>
              </template>
            </a-select>
            <a-input-search v-model="pageFilter.content" size="large" style="width:260px;" enter-button @search="onSearch" />
        </a-input-group>
      </div>
    </div>
</template>

<script>
import moment from "moment";
  export default {
    name: "myhead",
    data() {
      return {
        currentDate:'',
        pageFilter:{
          classification:'请选择',
        },
        classification:[
          {
            value:'1',
            name:'单位信息',
          },
          {
            value:'2',
            name:'人员信息',
          },
          {
            value:'3',
            name:'项目信息',
          },
        ]
      };
    },
    created() {
      // let date = new Date();
      // this.currentDate = moment().format("YYYY年MM月DD日");
      // let week = "星期" + "日一二三四五六".charAt(moment().format("E"));
      // this.currentDate = "今天是："+ this.currentDate+" "+week;
       this.currentDate = "今天是："+ moment().format('YYYY年MM月DD日') + ' ' + moment().format('dddd')
    },
    methods:{
      onBanner(){
        window.open("https://zhsw.swt.hainan.gov.cn:9300/ms/login.do");
      },
      onSearch(){
        if(this.pageFilter.classification=='请选择'){
          this.$message.warning("请选择分类");
          return;
        }else if(!this.pageFilter.content){
          this.$message.warning("请输入搜索内容");
          return;
        } else {
          localStorage.setItem('contentHeader',this.pageFilter.content)
        }

        if(this.pageFilter.classification=='1'){
          //单位
          this.$router.push({
            name:"workingUnitPage",
            query:{
                queryinput:this.pageFilter.content,
             }
          });
        }else if(this.pageFilter.classification=='2'){
          //人员
          this.$router.push({
            name:"workingPersonPage",
            query:{
                queryinput:this.pageFilter.content,
             }
          });
        }else if(this.pageFilter.classification=='3'){
          //项目
          this.$router.push({
            name:"projPublicInfoPage",
            query:{
                queryinput:this.pageFilter.content,
             }
          });
        }
      },
    },


  };
</script>
<style lang="less">
    .header{
      background: url(../../assets/head_img.png);
      width: 100%;
      height: 384px;
      filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale')";
      -moz-background-size:100% 100%;
      background-size:100% 100%;
    }

    // .logo{
    //     width: 363.5px;
    //     height: 38px;
    //     margin-top: 24.5px;
    //     position: absolute;
    //     left: 16.5%;
    // }
    // .currentdate{
    //     margin-top: 8.5px;
    //     position: absolute;
    //     right: 16.5%;
    // }
    // .search{
    //    margin-top: 37.5px;
    //    position: absolute;
    //    right: 16.5%;
    // }
.logo-div{
  width: 1200px;
  margin: 0 auto;
}
.logo {
    // width: 600px;
    // height: 70px;
    // position: relative;
    // margin-left: 16.7%;
    margin-top: 17px;
}
.currentdate {
    position: relative;
    width: 1200px;
    text-align: right;
    // right: 16.7%;
    margin: 0 auto;
    padding-top: 17px;
}

.search {
    position: relative;
    width: 1200px;
    text-align: right;
    // right: 16.7%;
    margin: 0 auto;
    margin-top: -44px;
}

    .searcchBtn{
        width:20px;
        height:20px;
        float: left;
        background: #337BD7;
        border-style:solid;
        border-radius: 0px 4px 4px 0px;
        border-color:#337BD7;
    }

    .searcchBtn img{
      width: 9px;
      height: 9px;
      margin-bottom: 10px;
      margin-left: 2.75px;
    }
 .header-back{
    color:#337BD7;
    height: 15px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;

 }
.header-back:hover{
      color: #005AB5;
      cursor: pointer;
      font-weight: 600;
    }
.header-classes{

  .ant-select-selection--single .ant-select-selection__rendered {
    margin-right: 70px;
  }
}
</style>
